import { onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { myUserStore, userInfoRule } from "../../store";
import { goToPage, hidePhoneNumber } from "../../utils/utils";
const userStore=myUserStore()

export default {
    setup(){
        const curretUser=ref<userInfoRule>(userStore.myUser)
        onLoad(async ()=>{
            // 如果当前页面未获取到用户信息 那么先进行获取
            if(curretUser.value._id==''){
                curretUser.value=await userStore.getMyUserInfo()
            }
        })
        return {
            curretUser,
            goToPage,
            hidePhoneNumber
        }
    }   
}